/**********************************************
** @Author: phy
** @Date:   2017-12-12 14:17:37
** @Last Modified by:   phy
***********************************************/
package controllers

import (
	"fmt"
	"strconv"
	//"strings"
	"time"

	"github.com/astaxie/beego"
	//"reflect"
	"WebAdminSys/libs"
	"WebAdminSys/models"
)

type UserRecordController struct {
	BaseController
}


func (self *UserRecordController) UserRecordTrade() {
	self.Data["pageTitle"] = "当日交易记录"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordTradeTable() {


	//用户信息
	UserGameID  := self.GetString("UserGameID");
	
	BeforDateTime := self.GetString("BeforDateTime");
	AfterDateTime := self.GetString("AfterDateTime");
	EndDateTime := self.GetString("EndDateTime");
	
	//推广号
	strsql := "";
	if UserGameID != ""{
	   	strsql = fmt.Sprintf("%s AND UGGSA.UserID = %s",strsql,UserGameID);
	}
		
	if  BeforDateTime != "" {	
		strsql = fmt.Sprintf("%s AND UGGSA.UpdateTime >= UNIX_TIMESTAMP('%s')",strsql,BeforDateTime);
	}
		
	if  AfterDateTime != "" {
		strsql = fmt.Sprintf("%s AND UGGSA.UpdateTime <= UNIX_TIMESTAMP('%s')",strsql,AfterDateTime);
	}

	if  EndDateTime != "" {
		strsql = fmt.Sprintf("%s AND UI.CHEATENDTIME <= UNIX_TIMESTAMP('%s')",strsql,EndDateTime);
	}

	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}
	self.pageSize = limit

	result, count,_ := models.RecordUserTradeData(page,self.pageSize,strsql);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
			row := make(map[string]interface{})

			row["columnA"] = v["GID"]
			row["columnB"] = v["UNAME"]
			row["columnC"] = v["ZiCHAN"];
			row["columnD"] = v["ALLWINLOSE"]
			row["columnE"] = v["TODAYWINLOSE"]
			row["columnF"] = v["BuyScore"];
			row["columnG"] = v["SellScore"];
			row["columnH"] = v["SURPLUS"]
			row["columnI"] = v["CHEATRATE"]
			row["columnJ"] = v["CHEATSCORE"]
			row["columnK"] = v["CHEATLEFTSCORE"]
			row["columnL"] = v["CHEATENDTIME"]
			list[k] = row
	}
	TitleData,_ := models.RecordUserTradeDataTitle(strsql);

	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)	

}

func (self *UserRecordController) UserRecordNewProtect() {
	self.Data["pageTitle"] = "新玩家保护列表"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordNewProtectTable() {


	//用户信息
	UserGameID  := self.GetString("UserGameID");
	
	userctrinfolist := self.GetString("userctrinfolist");
	useronlineinfolist := self.GetString("useronlineinfolist");
	EndDateTime := self.GetString("EndDateTime");
	userkind := self.GetString("userkind");
	   
	//推广号
	strsql := "";
	if UserGameID != ""{
	   	strsql = fmt.Sprintf("%s  AND UOI.ROOMID =  %s",strsql,UserGameID);
	}
		
	if  userctrinfolist == "1" {	
		strsql = fmt.Sprintf("%s  AND UI.CHEATRATE <> 0",strsql);
	}
		
	if useronlineinfolist == "1" {
		strsql = fmt.Sprintf("%s  AND UOI.ROOMID >= 0",strsql);
	}else if useronlineinfolist == "2" {
		strsql = fmt.Sprintf("%s  AND UOI.ROOMID IS NULL",strsql);
	}
			
	if  EndDateTime != "" {
		strsql = fmt.Sprintf("%s AND UI.CHEATENDTIME <= UNIX_TIMESTAMP('%s')",strsql,EndDateTime);
	}

	UserKindSql := [4]string{"(UI.FIRSTBUYGOLDTIME > (unix_timestamp(now()) - 3*24*3600) AND UI.ALLBUYSCORE > 140000 AND UI.ALLBUYSCORE <= 20000000 AND UI.ALLWINLOSE < -50000 AND UI.ALLWINLOSE >=  -10000000)",
							"(UI.FIRSTBUYGOLDTIME > (unix_timestamp(now()) - 7*24*3600) AND UI.ALLBUYSCORE > 20000000 AND UI.ALLBUYSCORE <= 50000000 AND UI.ALLWINLOSE < -10000000 AND UI.ALLWINLOSE > -25000000)",
							"(UI.FIRSTBUYGOLDTIME > (unix_timestamp(now()) - 10*24*3600) AND UI.ALLBUYSCORE > 50000000  AND  UI.ALLWINLOSE < -25000000)",
							"(UI.LASTLOGINTIME > (unix_timestamp(now()) - 10*24*3600) AND UI.ALLBUYSCORE > 10000000  AND  UI.ALLSELLSCORE < 1)"}
	StrUserKind := ""
	if userkind != ""{
		tmp := libs.GetStringOk(userkind,"|");
		for k,v := range tmp {
			index,err := strconv.Atoi(v.(string)) 

			if err == nil && index >= 1 &&  index <= len(UserKindSql){
				if k == 0{
					StrUserKind = fmt.Sprintf("%s %s " ,StrUserKind,UserKindSql[index-1])
				}else{
					StrUserKind = fmt.Sprintf("%s OR  %s " ,StrUserKind,UserKindSql[index-1])
				}
			}
		}	
	}else{
			for k := 0; k <4;k++ {
				if k == 0{
					StrUserKind = fmt.Sprintf("%s %s " ,StrUserKind,UserKindSql[k])
				}else{
					StrUserKind = fmt.Sprintf("%s OR  %s " ,StrUserKind,UserKindSql[k])
				}
			}
	}

	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}
	self.pageSize = limit
	iNowTime := libs.GetCurSysTmeTimeToUnix();

	result, count,_ := models.UserRecordNewProtectData(page,self.pageSize,strsql,StrUserKind);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
			row := make(map[string]interface{})

			row["columnA"] = models.UserNewKind(v["FIRSTBUYGOLDTIME"],v["ALLBUYSCORE"],v["ALLWINLOSE"],v["LASTLOGINTIME"],v["ALLSELLSCORE"],iNowTime)
			row["columnB"] = v["UGID"]
			row["columnC"] = v["UNICKNAME"];
			I64LastBuyTime,_ := strconv.ParseInt(v["LASTLOGINTIME"].(string), 10, 64)
			row["columnD"] = beego.Date(time.Unix(I64LastBuyTime, 0), "Y-m-d H:i:s")
			row["columnE"] = v["zichan"]
			row["columnF"] = v["ALLWINLOSE"];
			row["columnG"] = v["TODAYWINLOSE"];
			row["columnH"] = v["ALLBUYSCORE"]
			row["columnI"] = v["ALLSELLSCORE"]
			row["columnJ"] = models.GetUserStatusInFo(v["UOROOMID"]);
			row["columnK"] = v["CHEATRATE"]
			row["columnL"] = v["CHEATSCORE"]
			row["columnM"] = v["CHEATLEFTSCORE"]
			row["columnN"] = v["CHEATENDTIME"]
			list[k] = row
	}
	TitleData,_ := models.UserRecordNewProtectDataTitle(strsql,StrUserKind);

	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)	

}


func (self *UserRecordController) UserRecordCare() {
	self.Data["pageTitle"] = "关怀用户列表"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordCareTable() {

	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}
	self.pageSize = limit
	strsql := "AND UI.Is_follow = 1"
	result, count,_ := models.UserRecordCareData(page,self.pageSize,strsql);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
			row := make(map[string]interface{})

			row["columnA"] = v["UGID"]
			row["columnB"] = v["UNICKNAME"]
			row["columnC"] = v["zichan"];
			row["columnD"] = v["ALLWINLOSE"]
			row["columnE"] = v["TODAYWINLOSE"]
			row["columnF"] = v["ALLBUYSCORE"];
			row["columnG"] = v["ALLSELLSCORE"];
			row["columnH"] = v["CHEATRATE"]
			row["columnI"] = v["CHEATSCORE"]
			row["columnJ"] = v["CHEATLEFTSCORE"]
			row["columnK"] = models.GetUserStatusInFo(v["UOROOMID"]);
			list[k] = row
	}
	TitleData,_ := models.UserRecordCareDataTitle(strsql);

	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)	

}
func (self *UserRecordController) UserRecordOnLine() {
	self.Data["pageTitle"] = "用户在线列表"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordOnLineTable() {

	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}
	self.pageSize = limit


	UserRoomID  := self.GetString("UserRoomID");
	userctrinfolist := self.GetString("userctrinfolist");
	gameplatform := self.GetString("gameplatform");

	strsql := "";
	if UserRoomID != ""{
	   	strsql = fmt.Sprintf("%s  AND UOI.ROOMID =  %s",strsql,UserRoomID);
	}
		
	if  userctrinfolist == "1" {	
		strsql = fmt.Sprintf("%s  AND UI.CHEATRATE <> 0",strsql);
	}
	if gameplatform != ""{
		strsql = fmt.Sprintf("%s  AND UI.PLATFORM = %s",strsql,gameplatform);
	}
	result, count,_ := models.UserRecordOnLineData(page,self.pageSize,strsql);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
			row := make(map[string]interface{})

			row["columnA"] =  models.GetUserStatusInFo(v["UOROOMID"])
			row["columnB"] = v["UGID"]
			row["columnC"] = v["UNAME"];
			row["columnD"] = v["URTIME"]
			row["columnE"] = v["ULLTIME"]
			row["columnF"] = v["USERALLC"];
			row["columnG"] = v["zichan"];
			row["columnH"] = v["UALLWINLOSE"]
			row["columnI"] = v["UTODAYW"]
			row["columnJ"] = v["ALLSELLSCORE"]
			row["columnK"] =v["CHEATRATE"]
			row["columnL"] =v["CHEATSCORE"]
			row["columnM"] =v["CHEATLEFTSCORE"]
			row["columnN"] =v["UCHEAT"]

			list[k] = row
	}
	TitleData,_ := models.UserRecordOnLineDataTitle(strsql);

	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)	

}

func (self *UserRecordController) UserRecordMail() {
	self.Data["pageTitle"] = "用户邮件列表"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordMailTable() {

		//用户信息
	UserGameID  := self.GetString("UserGameID");


	BeforDateTime := self.GetString("BeforDateTime");
	AfterDateTime := self.GetString("AfterDateTime");
	GMUserName := self.GetString("GMUserName");
	isabnormal := self.GetString("isabnormal");
	userWinLose := self.GetString("userWinLose");

	//推广号
	strsql := "";
	if UserGameID != "" && isabnormal == "1" {
	   	strsql = fmt.Sprintf("%s  AND M.GameID = %s",strsql,UserGameID);
	}
	if UserGameID != "" && isabnormal == "2" {
	   	strsql = fmt.Sprintf("%s  AND M.UserID = %s",strsql,UserGameID);
	}
	if UserGameID != "" && isabnormal == "3" {
	   	strsql = fmt.Sprintf("%s  AND U.NickName = '%s'",strsql,UserGameID);
	}
			
	if  BeforDateTime != "" {	
		strsql = fmt.Sprintf("%s AND OpTime >= '%s'",strsql,BeforDateTime);
	}
		
	if  AfterDateTime != "" {
		strsql = fmt.Sprintf("%s AND OpTime <= '%s'",strsql,AfterDateTime);
	}

	if GMUserName != ""{
		strsql = fmt.Sprintf("%s AND RealName LIKE '%%%s%%'",strsql,GMUserName);
	}

	if userWinLose != ""{
		strsql = fmt.Sprintf("%s   AND M.`Status`= %s ",strsql,userWinLose);
	}

  
	    	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}

	self.pageSize = limit



	result, count,_ := models.RecordMailData(page,self.pageSize,strsql);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
		row := make(map[string]interface{})

		row["ugameID"] = v["MGAMEID"]
		row["unickname"] = v["USERNAME"]
		row["GMUserName"] = v["RealName"];
		row["OprateTime"] = v["OpTime"]
		row["GetGold"] = v["MGOLD"]
		row["title"] = v["Title"];
		row["Content"] = v["Content"];
		row["Status"] = models.GetMailStatus(v["MStatus"]);
		
		list[k] = row
	}

	TitleData,_ := models.RecordMailDataTitle(strsql);
	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)	

}
func (self *UserRecordController) UserRecordNewCard() {
	self.Data["pageTitle"] = "用户手机验证码"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordNewCardTable() {

   	self.ajaxList("成功", MSG_OK, 0, nil)	
  			
}


func (self *UserRecordController) UserRecordPhoneCode() {
	self.Data["pageTitle"] = "用户手机验证码"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordPhoneCodeTable() {
//用户信息
		UserGameID,err  := self.GetInt64("UserGameID");
   		if err != nil{
   			self.ajaxList("成功", MSG_OK, 0, nil)	
   			return
   		}
		result := models.ExtremVipUserInfoByUserID(UserGameID,"GAMEID","NICKNAME","VERIFYCODE");
		list := make([]map[string]interface{}, len(result))
		for k, v := range result {
			row := make(map[string]interface{})
			row["columnA"] = v["VERIFYCODE"];
			row["columnB"] = v["GAMEID"]
			row["columnC"] = v["NICKNAME"]

			list[k] = row
		}


		self.ajaxList("成功", MSG_OK, 0, list)	

}


func (self *UserRecordController) UserRecordgoldChange() {
	self.Data["pageTitle"] = "金币变动记录"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordgoldChangeTable() {

	//用户信息
	UserGameID  := self.GetString("UserGameID");
 
    //列表
    page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}
	self.pageSize = limit

    BeforDateTime := self.GetString("BeforDateTime");
	AfterDateTime := self.GetString("AfterDateTime");
	uRoomID := self.GetString("uRoomID");
	uMemo := self.GetString("uMemo");

	//推广号
	strsql := "";
	strsql = fmt.Sprintf("%s AND GameID = %s",strsql,UserGameID);

	if  BeforDateTime != "" {
			
		strsql = fmt.Sprintf("%s AND ChangeTime >= UNIX_TIMESTAMP('%s')",strsql,BeforDateTime);
	}
		
	if  AfterDateTime != "" {	
		strsql = fmt.Sprintf("%s AND ChangeTime <= UNIX_TIMESTAMP('%s')",strsql,AfterDateTime);
	}
	if uRoomID != ""{
		strsql = fmt.Sprintf("%s AND ServerID = %s",strsql,uRoomID);
	}

	if uMemo != ""{
		strsql = fmt.Sprintf("%s AND Memo LIKE '%%%s%%'",strsql,uMemo);
	}
		

	filters := models.GetUserGoldChangeTableNames(BeforDateTime,AfterDateTime,"Y-m-d H:i:s");

	result, count,_ := models.RecordGoldChangeData(page,self.pageSize,strsql,filters...);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
		row := make(map[string]interface{})

		row["logTime"] = v["ChangeTime"]
		row["logs"] = v["Memo"]

		row["goldChange"] = v["ChangeGold"];

		row["goldChange1"] = v["CGold"]
		row["golds"] = v["Gold"]
		row["golds1"] = v["InsureGold"]
		row["allGolds"] = v["ZiChan"]
		row["ctrlstatus"] = v["CheatRate"]
		list[k] = row
	}

	
	strsql2 := fmt.Sprintf(" AND UI.GameID = %s",UserGameID);

	TitleData,_ := models.UserInfoDataByCondtion(strsql2);

	self.ajaxTilteList("成功", MSG_OK, count,TitleData,list)

}

func (self *UserRecordController) UserRecordLogin() {
	self.Data["pageTitle"] = "用户登录记录"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordLoginTable() {

	//列表
	page, err := self.GetInt("page")
	if err != nil {
		page = 1
	}
	limit, err := self.GetInt("limit")
	if err != nil {
		limit = 30
	}

	self.pageSize = limit

	//用户信息
	UserGameID := self.GetString("UserGameID");
   
    BeforDateTime := self.GetString("BeforDateTime");
    AfterDateTime := self.GetString("AfterDateTime");
  


    //推广号
    strsql := "";
	strsql = fmt.Sprintf("%s AND GameID = %s",strsql,UserGameID);

	if  BeforDateTime != "" {
		
		strsql = fmt.Sprintf("%s AND EnterTime >= UNIX_TIMESTAMP('%s')",strsql,BeforDateTime);
	}
	
	if  AfterDateTime != "" {
		
		strsql = fmt.Sprintf("%s AND EnterTime <= UNIX_TIMESTAMP('%s')",strsql,AfterDateTime);
	}
	

	result, count,_ := models.RecordLoginData(page,self.pageSize,strsql)
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
		row := make(map[string]interface{})

		row["UserID"] = v["GameID"]
		row["UserNickName"] = v["NickName"]

		row["roomID"] = v["SID"];

		row["roomName"] = v["RoonName"]
		row["ugold"] = v["Gold"]
		row["uinsergold"] = v["InsureGold"]
		row["uallgold"] = v["ZiChan"]
		row["loginTime"] = v["ET"]
		row["loginip"] = v["IP"]
		row["loginmac"] = v["MAC"]
		row["loginkind"] = models.GetUserLoginKindName(v["Tpye"])
		list[k] = row
	}

	self.ajaxList("成功", MSG_OK, count, list)	

}


func (self *UserRecordController) UserRecordLock() {
	self.Data["pageTitle"] = "用户登录记录"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordLockTable() {
//用户信息
		UserGameID  := self.GetString("UserGameID");
   
	    //列表
		page, err := self.GetInt("page")
		if err != nil {
			page = 1
		}
		limit, err := self.GetInt("limit")
		if err != nil {
			limit = 30
		}

		self.pageSize = limit

    	BeforDateTime := self.GetString("BeforDateTime");
	    AfterDateTime := self.GetString("AfterDateTime");
	  

	    //推广号
	    strsql := "";
	    if UserGameID != ""{
	    	strsql = fmt.Sprintf("%s AND GAMEID = %s",strsql,UserGameID);
	    }
		
		if  BeforDateTime != "" {
			
			strsql = fmt.Sprintf("%s AND OPRATETIME >= UNIX_TIMESTAMP('%s')",strsql,BeforDateTime);
		}
		
		if  AfterDateTime != "" {
			
			strsql = fmt.Sprintf("%s AND OPRATETIME <= UNIX_TIMESTAMP('%s')",strsql,AfterDateTime);
		}
		
		result, count,_ := models.RecordLockData(page,self.pageSize,strsql);
		list := make([]map[string]interface{}, len(result))
		for k, v := range result {
			row := make(map[string]interface{})

			row["UserID"] = v["GAMEID"]
			row["UserNickName"] = v["NICKNAME"]

			row["RegTime"] = v["REGTIME"];

			row["LastLoginTime"] = v["LASTLIGNTIME"]
		
			row["uallgold"] = v["ALLGOLD"]
			row["uallwin"] = v["ALLWIN"]
			row["oType"] = models.GetLockStatus(v["TYPE"]);
			row["reson"] = v["CONTEXT"]
			row["operatetime"] = v["OPRATETIME"]
			row["GmName"] = v["RealName"]

			list[k] = row
		}


		self.ajaxList("成功", MSG_OK, count, list)	

}

func (self *UserRecordController) UserRecordWinLose() {
	self.Data["pageTitle"] = "用户输赢记录"
	self.AddOperationLog(fmt.Sprintf("进入【%s】页面",self.Data["pageTitle"]),1)

	self.display()
}

func (self *UserRecordController) UserRecordWinLoseTable() {


    BeforDateTime := self.GetString("BeforDateTime");
	AfterDateTime := self.GetString("AfterDateTime");
	
	limit, err := self.GetInt("Gamelimit")
	if err != nil {
		limit = 10
	}

	//推广号
	strsql := "";

	uRoomID,err := self.GetInt("ServerID");
	if err == nil {
		strsql = fmt.Sprintf("%s AND ServerID = %d",strsql,uRoomID);
	}

	if  BeforDateTime != "" {
			
		strsql = fmt.Sprintf("%s AND ChangeTime >= UNIX_TIMESTAMP('%s')",strsql,BeforDateTime);
	}
		
	if  AfterDateTime != "" {
		iAterDate,_ := libs.GetDateToInt(AfterDateTime,"Y-m-d","Ymd");
		iAterDate += 1;
		strAterDate:=strconv.Itoa(iAterDate) 
		strAterDate = libs.GetDateToString(strAterDate,"Ymd","Y-m-d")
		strsql = fmt.Sprintf("%s AND ChangeTime <= UNIX_TIMESTAMP('%s')",strsql,strAterDate);
	}

	strsql2 := ""
	UserWinGoldL,err := self.GetInt64("UserWinGoldL");
	if err	== nil{
		strsql2 = fmt.Sprintf("%s AND ALLD.ChangeGold >= %d",strsql2,UserWinGoldL);
	}
	UserWinGoldB,err := self.GetInt64("UserWinGoldB");
	if err	== nil{
		strsql2 = fmt.Sprintf("%s AND ALLD.ChangeGold <= %d",strsql2,UserWinGoldB);
	}

	//filters := make([]interface{}, 0)
	//filters = append(filters, "UserScoreChange_20171106")
	//filters = append(filters, "UserScoreChange_20171107")

	filters := models.GetUserGoldChangeTableNames(BeforDateTime,AfterDateTime,"Y-m-d");
	//fmt.Println("wwwwwwwwwwwwwww",filters);
	result, count,_ := models.UserRecordWinLoseData(limit,strsql,strsql2,filters...);
	list := make([]map[string]interface{}, len(result))
	for k, v := range result {
		row := make(map[string]interface{})

		row["columnA"] = v["GID"]
		row["columnB"] = v["ChangeGold"]
		list[k] = row
	}

	self.ajaxList("成功", MSG_OK,count,list)	

}